<?php
class Product extends AppModel {

    public $name = 'Product';
    public $displayField = "product_name";

    public $validate = array(
        'product_name' => array(
            'required' => array(
                'rule' => 'notEmpty',
                'message' => 'add product name'
            ),
            'unique' => array(
                'rule' => 'isUnique',
                'message' => 'product name must be unique'
            ),
        ),
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed
    public $belongsTo = array(
                    'Category' => array('className' => 'Category',
                                                            'foreignKey' => 'category_id',
                                                            'conditions' => '',
                                                            'fields' => '',
                                                            'order' => ''
                    )
    );

    public $hasMany = array(
                    'Size' => array('className' => 'Size',
                                                            'foreignKey' => 'product_id',
                                                            'dependent' => true,
                                                            'conditions' => '',
                                                            'fields' => '',
                                                            'order' => '',
                                                            'limit' => '',
                                                            'offset' => '',
                                                            'exclusive' => '',
                                                            'finderQuery' => '',
                                                            'counterQuery' => ''
                    )
    );
}
?>